<template>
  <div class="header">
    <div class="item">
      <div class="time">
        <div>{{ datetime }}</div>
        <div>{{ time }}</div>
      </div>
      <div class="title">智慧城市-武汉</div>
    </div>
  </div>
</template>

<script setup>
import { ref } from "vue";
const time = ref(new Date().toLocaleTimeString());
const datetime = ref(new Date().toLocaleDateString());

setInterval(() => {
  time.value = new Date().toLocaleTimeString();
}, 1000);

</script>
<style scoped>
.header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 3;
  color: white;
  width: 100vw;
  height: 70px;
  background-image: url(../assets/images/header.png);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  padding: 1px;
  font-size: 25px;
}
.item {
  display: flex;
  justify-content: center;
}
.time {
  font-size: 20px;
  position: absolute;
  font-family: "Times New Roman", Times, serif;
  top: 20px;
  left: 30px;
}
.title {
  margin-top: 10px;
}
</style>
